<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{% extends "base.html" %}

{% block content %}
<h2>博客文章</h2>
{% if posts %}
    <div class="posts">
        {% for post in posts %}
            <div class="post">
                <h3><a href="{{ url_for('blog.post', post_id=loop.index) }}">{{ post.title }}</a></h3>
                <p>{{ post.content[:100] }}{% if post.content|length > 100 %}...{% endif %}</p>
                <a href="{{ url_for('blog.post', post_id=loop.index) }}">阅读更多</a>
            </div>
            <hr>
        {% endfor %}
    </div>
{% else %}
    <p>暂无博客文章</p>
{% endif %}
{% endblock %}
</body>
</html>